Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

api: return error when LicenseGet status is not 200 #11644

Merged
merged 3 commits into from
Dec 15, 2021
Merged

Conversation

lgfa29
Copy link
Contributor

@lgfa29 lgfa29 commented Dec 7, 2021

Without this check, the api package tries to parse the response as JSON regardless of status code. But in some situations, like with invalid ACL tokens, the response body is a plain text message, resulting in weird errors like this being sent to clients that make use of the Nomad api package:

invalid character 'P' looking for beginning of value

Copy link
Member

@tgross tgross left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

api/operator_ent_test.go Outdated Show resolved Hide resolved
Copy link
Contributor

@DerekStrickland DerekStrickland left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@lgfa29 lgfa29 merged commit 86e2dd7 into main Dec 15, 2021
@lgfa29 lgfa29 deleted the api-license-get-200 branch December 15, 2021 00:47
@github-actions
Copy link

github-actions bot commented Nov 7, 2022

I'm going to lock this pull request because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active contributions.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 7, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants